package me.zhengjie.modules.common.service;

import me.zhengjie.modules.common.domain.TRegion;
import me.zhengjie.modules.common.service.dto.TRegionDTO;
import me.zhengjie.modules.common.service.dto.TRegionQueryCriteria;
import org.springframework.data.domain.Pageable;

/**
 * Created by bruce on 2021/4/23.
 */
public interface TRegionService {
    /**
     * queryAll 分页
     * @param criteria
     * @param pageable
     * @return
     */
    //@Cacheable(keyGenerator = "keyGenerator")
    Object queryAll(TRegionQueryCriteria criteria, Pageable pageable);

    /**
     * queryAll 不分页
     * @param criteria
     * @return
     */
    //@Cacheable(keyGenerator = "keyGenerator")
    public Object queryAll(TRegionQueryCriteria criteria);

    /**
     * findById
     * @param id
     * @return
     */
    //@Cacheable(key = "#p0")
    TRegionDTO findById(Long id);

    TRegion findByName(String name);

    /**
     * create
     * @param resources
     * @return
     */
    //@CacheEvict(allEntries = true)
    TRegionDTO create(TRegion resources);

    /**
     * update
     * @param resources
     */
    //@CacheEvict(allEntries = true)
    void update(TRegion resources);

    /**
     * delete
     * @param id
     */
    //@CacheEvict(allEntries = true)
    void delete(Long id);
}
